<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="commons/header :: common-header(~{::title}, ~{})">
    <title>投稿</title>
</head>
<body>
<!-- Header -->
<div th:replace="commons/header :: header"></div>

<div class="container content_container">
    <div class="col-xs-12 col-sm-11 col-md-11 col-lg-11">
        <h2 class="text-center text-success" th:if="msg" th:text="${msg}"></h2>
        <form class="form-horizontal" th:action="@{/video/contribute}" th:if="not ${msg}" th:method="post" th:object="${video}">
            <div class="form-group">
                <label class="col-sm-2 control-label" for="title">视频标题</label>
                <div class="col-sm-10">
                    <input class="form-control" id="title" placeholder="输入视频标题哦" required th:field="*{title}" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="url">视频链接</label>
                <div class="col-sm-10">
                    <input class="form-control" id="url" placeholder="输入视频链接地址" required th:field="*{url}" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="intro">视频介绍</label>
                <div class="col-sm-10">
                    <textarea class="form-control" id="intro" placeholder="视频介绍" required rows="3" th:field="*{intro}"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="up_name">B站账号(视频所在网站账号)</label>
                <div class="col-sm-10">
                    <input class="form-control" id="up_name" placeholder="" required th:field="*{upName}" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="majorId">所属专业</label>
                <div class="col-sm-10">
                    <select class="form-control" id="majorId" name="majorId" th:field="*{majorId}">
                        <option value="">请选择所属专业</option>
                        <option th:each="major:${majors}" th:text="${major.name}" th:value="${major.id}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label" for="upContact">联系方式(qq或者微信)</label>
                <div class="col-sm-10">
                    <input class="form-control" id="upContact" placeholder="如果信息有误，方便我联系您更正信息哟~不会泄露您的联系方式" required th:field="*{upContact}" type="text">
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-10">
                    <button class="btn btn-primary btn-block" type="submit">投稿</button>
                </div>
            </div>
        </form>
    </div>
</div>
<footer>
    <div th:replace="commons/footer :: footer(~{})"></div>
</footer>
</body>
</html>